package cn.ly.objdata;

import java.util.ArrayList;
import java.util.List;

import cn.ly.util.ArithmeticTool;

public class DataApp {
	
	public static void main(String[] args) {
		
		List list = new ArrayList<String>();
		
		DataArray arr = new DataArray(100);
		int ranTemp = -1;
		Person p;
		for(int i = 0; i < 10; i++){
			ranTemp = ArithmeticTool.getIntRandom0to100();
			p = new Person(ranTemp%10+1+"",
					getRandomFirstName(ranTemp%10),ranTemp%10+25);
			arr.insert(p);
		}
		
		arr.displayArr();
		
		//p = new Person("5","邓",29);
		arr.insertSort();
		
		arr.displayArr();
		
		displayFirstName();
		
		
		
		
		
	}
	
	private static String getRandomFirstName(int i){
		String[] fn = {"张","李","王","刘","邓","欧阳","西门","郭","黄","岳"};
		return fn[i];
	}
	
	private static void displayFirstName(){
		String[] fn = { "张".toCharArray()[0]+0 + "张",
				"李".toCharArray()[0]+0 + "李",
				"王".toCharArray()[0]+0 + "王",
				"刘".toCharArray()[0]+0 + "刘",
				"邓".toCharArray()[0]+0 + "邓",
				"欧阳".toCharArray()[0]+0 + "欧阳",
				"西门".toCharArray()[0]+0 + "西门",
				"郭".toCharArray()[0]+0 + "郭",
				"黄".toCharArray()[0]+0 + "黄",
				"岳".toCharArray()[0]+0 + "岳"};
		
		for(int i=0; i < 10; i++){
			System.out.println(fn[i]);
		}
	}
	

}
